package com.woniu.bedinfo.controller;

import com.woniu.bedinfo.service.JpBedDrService;
import com.woniu.common.entity.JpBedDr;
import com.woniu.common.utils.ResultVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 啊川
 * @version 1.0
 * @date 2021/9/17 16:00
 * @QQ 836782490
 * @content:
 */
@RestController
@RequestMapping("JpBedDr")
public class JpBedDrController {

    @Resource
    private JpBedDrService jpBedDrService;

    @GetMapping("findAll")
    public ResultVO findAll() {
        try {
            List<JpBedDr> jpBedDrList = jpBedDrService.findAll();

            if (jpBedDrList != null){
                return ResultVO.success("床位记录查询成功",jpBedDrList);
            }else {
                return ResultVO.fail("床位记录查询失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return ResultVO.fail("床位记录查询异常");
        }
    }
}
